home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / prim / package-admin.el.z / package-admin.el
Encoding:
Text File  |  1998-05-21  |  2.6 KB  |  82 lines

  1. ;;; package-admin.el --- Installation and Maintenance of XEmacs packages
  2.  
  3. ;; Copyright (C) 1997 by Free Software Foundation, Inc.
  4.  
  5. ;; Author: SL Baur <steve@altair.xemacs.org>
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of XEmacs.
  9.  
  10. ;; XEmacs is free software; you can redistribute it and/or modify it
  11. ;; under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; XEmacs is distributed in the hope that it will be useful, but
  16. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. ;; General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  22. ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  23. ;; 02111-1307, USA.
  24.  
  25. ;;; Synched up with: Not in FSF
  26.  
  27. ;;; Commentary:
  28.  
  29. ;; First pass at lisp front end to package maintenance.
  30.  
  31. ;;; Code:
  32.  
  33. (require 'config)
  34.  
  35. (defvar package-admin-xemacs (concat (config-value 'top_srcdir)
  36.                      "/src/xemacs")
  37.   "Location of XEmacs binary to use.")
  38.  
  39. (defvar package-admin-temp-buffer "*Package Output*"
  40.   "Temporary buffer where output of backend commands is saved.")
  41.  
  42. ;;;###autoload
  43. (defun package-admin-add-single-file-package (file destdir &optional pkg-dir)
  44.   "Install a single file Lisp package into XEmacs package hierarchy.
  45. `file' should be the full path to the lisp file to install.
  46. `destdir' should be a simple directory name.
  47. The optional `pkg-dir' can be used to override the default package hiearchy
  48. \(last package-path)."
  49.   (interactive "fLisp File: \nsDestination: ")
  50.   (when (null pkg-dir)
  51.     (setq pkg-dir (cadr package-path)))
  52.   (let ((destination (concat pkg-dir "/lisp/" destdir))
  53.     (buf (get-buffer-create package-admin-temp-buffer)))
  54.     (call-process "add-little-package.sh"
  55.           nil
  56.           buf
  57.           t
  58.           ;; rest of command line follows
  59.           package-admin-xemacs file destination)))
  60.  
  61. ;;;###autoload
  62. (defun package-admin-add-binary-package (file &optional pkg-dir)
  63.   "Install a pre-bytecompiled XEmacs package into package hierarchy."
  64.   (interactive "fPackage tarball: ")
  65.   (when (null pkg-dir)
  66.     (when (or (not (listp package-path))
  67.           (not package-path))
  68.       (error "No package path"))
  69.     (setq pkg-dir (car (last package-path))))
  70.  
  71.   (let ((buf (get-buffer-create package-admin-temp-buffer)))
  72.     (call-process "add-big-package.sh"
  73.           nil
  74.           buf
  75.           t
  76.           ;; rest of command line follows
  77.           package-admin-xemacs file pkg-dir)))
  78.  
  79. (provide 'package-admin)
  80.  
  81. ;;; package-admin.el ends here
  82.